<?php

namespace App\Http\Controllers\Api;

use App\Models\News;
use App\Http\Resources\Api\News as NewsCollection;

class NewsController extends Controller
{

    public function index()
    {
        $result = News::where('is_display', 1)
            ->orderByDesc('sort')
            ->orderByDesc('id')
            ->get();
        return new NewsCollection($result);
    }
}
